#include "stc.h"
int gen[5000][2]={0};
int generated(int n){
int sum = n;
	while(n != 0) {
		sum = sum + n%10;
		n = n/10;
	}
	return sum;
}

void main()
{int i = 1;
	while( i < 5000) {
	int j = generated(i);

	if(gen[j][0] !=0) gen[j][1]=i;
	else gen[j][0]=i;
	  i = i + 1;
	}
	PutStr("selt of number : \n\n");
	i = 1;
	int total = 0;
	int count = 0;
	while ( i < 5000) {
		if (gen[i][0] == 0) {
			PutInt(i);
			PutStr("\t");
			total = total + i;
		}

		else {
			if (gen[i][1] != 0) {
				count = count + 1;
			}
		}
		i = i+1;
	}

	PutStr("\n\n\ntotal of selt-number :");
	PutInt(total);
	PutStr("\n\n\nnumber of duplicate : ");
	PutInt(count);
	PutStr("\n");
	i = 1;
	while (i < 5000) {
		if (gen[i][1] != 0) {
			PutInt(i);
			PutStr("\t");
			PutInt(gen[i][0]);
			PutStr("\t");
			PutInt(gen[i][1]);
			PutStr("\n");
		}
		i = i+1;
	}
}